<template>
  <div class="app-container">
    <el-table
      v-loading="listLoading"
      :data="list"
      element-loading-text="拼命加载中"
      border
      fit
      highlight-current-row
    >
      <el-table-column align="center" label="序号" width="95">
        <template slot-scope="scope">
          {{ scope.$index }}
        </template>
      </el-table-column>
      <el-table-column label="基金编码" prop="fundCode" width="100" />
      <el-table-column label="基金名称" prop="fundName" width="300" />
      <el-table-column label="当前涨幅" prop="currentIncrease" width="100" />
    </el-table>

    <div align="right">
      <pagination v-show="total>0" align="right" :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" @pagination="fetchData" />
    </div>

  </div>
</template>

<script>
import Pagination from '@/components/Pagination'
import { getList } from '@/api/fundUserRemindData'

export default {
  components: { Pagination },
  data() {
    return {
      total: 0,
      listQuery: {
        page: 1,
        limit: 10
      },
      list: null,
      listLoading: true
    }
  },
  created() {
    this.fetchData()
  },
  methods: {
    fetchData() {
      var vm = this
      vm.listLoading = true
      getList(this.listQuery.page, this.listQuery.limit).then(response => {
        vm.total = Number(response.data.total)
        vm.list = response.data.records
        vm.listLoading = false
      })
    }
  }
}
</script>
